Well-known magnetic encoders for detecting the rotation angle and other quantities of a rotating body include devices provided with a bipolarly magnetized ring magnet, as shown in FIG. 6(a). In such a magnetic encoder 1, a bipolarly magnetized ring magnet 2 is attached so as to rotate integrally with the rotating body to be detected (not shown). Two magnetic sensors 3X, 3Y are positioned at a 90-degree angular spacing in the circumferential direction facing the outer circumferential surface 2a of the ring magnet 2 across a set gap.
When the ring magnet 2 rotates together with the rotating body, sinusoid detection signals that are shifted in phase by 90 degrees are output from the magnetic sensors 3X, 3Y. For example, the X-phase detection signal shown by the thick line in FIG. 6(b) is output from the magnetic sensor 3X, and the Y-phase detection signal shown by the thin line is output from the magnetic sensor 3Y.
These detection signals, which have phases shifted by 90 degrees, are fed to a computing part 4. The computing part 4 calculates the angle of rotation of the ring magnet 2 on the basis of the waveforms of the detection signals and generates encoder pulse signals that represent the angle of rotation, direction of rotation, and other properties. The encoder pulse signals are fed to a drive control circuit (not shown) or other component of the rotating body.
The ring magnet 2 of the bipolar magnetic encoder 1 constructed in this fashion is magnetized by placing a magnetic ring 12 within the parallel magnetic field shown by the arrow in FIG. 7(a). The magnetic permeability of the air is lower than the magnetic permeability of the magnetic ring 12. The magnetic permeability of the commonly used magnetic ring 12 is 1.1 to 1.3, whereas the magnetic permeability of air is 1.0. Therefore, as shown in FIG. 7(b), when the magnetic ring 12 is in a parallel magnetic field, the direction of the magnetic flux is bent at the inner circumferential surface A and the outer circumferential surface B of the magnetic ring 12, and the direction of the magnetic flux passing within the magnetic ring 12 is inclined relative to the parallel magnetic field.
When the rotating magnetic field of the bipolarly magnetized ring magnet 2 is detected by a magnetic sensor in this state, odd-order harmonic components are generated as noise in the detected waveforms as a result of the slight incline of the magnetic flux during magnetization. As a result, an adverse effect occurs in which the noise components have the effect of degrading the accuracy of detecting the angle of rotation when this ring magnet 2 is used in the fabrication of the magnetic encoder shown in FIG. 6(a).